﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="smsbox.aspx.cs" Inherits="AnyOffice.general.ipanel.smsbox" %>

<html>
	<head>
		<title>短信息</title>
		<script type="text/javascript" language="JavaScript">
	window.setTimeout('this.location.reload();',60000);
	
	function delete_all()
	{
		msg="确认要删除以上列出的短信吗？";
		if(window.confirm(msg))	
			return true;
		else
			return false;
}

//发送消息
function send_sms(to_id, to_name) {
    mytop = screen.availHeight - 190;
    myleft = 0;
   // window.open("/general/status_bar/sms_back.aspx?to_id=" + to_id + "&to_name=" + to_name, "send_sms", "height=160,width=350,status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=" + mytop + ",left=" + myleft + ",resizable=yes");
    parent.frames["MainIframe"].location = "/general/status_bar/sms_back.aspx?to_id=" + to_id + "&to_name=" + to_name;
}

//发送邮件
function send_email(to_id, to_name) {
    // parent.main.location = "/general/email/new.aspx?to_id=" + to_id + "&to_name=" + to_name;
    parent.frames["MainIframe"].location = "/general/email/new.aspx?to_id=" + to_id + "&to_name=" + to_name;
}

//-------- 打开网址 -------
function openURL(URL) {
    parent.frames["MainIframe"].location = URL;
}


		</script>
	</head>
	<body class="panel" topmargin="0" leftmargin="0">
		<form id="Form1" method="post" runat="server">
			<asp:Panel id="pnlMain" runat="server" EnableViewState="False">
					
					<asp:Repeater id="rptSms" runat="server" EnableViewState="False">
					<HeaderTemplate>
					<table class="TableBlock" width="100%" cellspacing="0" cellpadding="2" class="small">
					</HeaderTemplate>
				<ItemTemplate>				
					<TR>
						<TD class="TableHeader">
						<IMG alt="<%#Eval("CodeName")%>" src="<%#Convert.ToInt32(Eval("Type"))==0 ? "/images/avatar/" + Eval("Avatar") + ".gif" : "/images/sms_type" + Eval("Type") + ".gif"%>" align="absMiddle"> <%#Eval("CodeName")%>
						</TD>
					</TR>
					<TR>
						<TD class="TableData"><U title="部门：<%#Eval("DeptName")%>" style="CURSOR: hand"><%#Eval("UserName")%></U>：<%#formatContent(Eval("Content").ToString())%><BR>
							<I><%#Eval("SendTime")%></I><BR>
							<DIV align="right"><A onclick="send_sms('<%#Eval("FromId")%>','<%#Eval("UserName")%>');" href="#">回复</A>&nbsp;&nbsp;
								<%#Eval("Url") != DBNull.Value ? "&nbsp;<A title=\"到相应的模块去\" href=\"javascript:openURL('" + Eval("Url") + "');\">链接</A>&nbsp;" : ""%>
								<%#Eval("Url") == DBNull.Value && Eval("FuncCode") != DBNull.Value ? "&nbsp;<A title=\"到相应的模块去\" href=\"javascript:openURL('/general/" + Eval("FuncCode")+"" + "');\">链接</A>&nbsp;" : ""%>
								<A href="smsbox_delete.aspx?sms_id=<%#Eval("SmsId")%>">删除</A>&nbsp;
								
							</DIV>
						</TD>
					</TR>				
				</ItemTemplate>
				<FooterTemplate>
				</table>
				</FooterTemplate>
			</asp:Repeater>
					<div align="center">
					<br />
						<INPUT class="SmallButton" title="删除以上列出的短信" onclick="return delete_all();" type="submit" value="删除以上短信">						
					</div>				
			</asp:Panel>			
			<asp:Literal id="litMessage" runat="server" EnableViewState="False"></asp:Literal>
		</form>
	</body>
</html>
